package cn.lysj.framework.store.domain;

import cn.lysj.framework.base.BaseEntity;
import cn.lysj.framework.common.RelationType;
import cn.lysj.framework.common.annotation.Relation;
import cn.lysj.framework.common.domain.User;
import cn.lysj.framework.common.validate.annotation.NotBlank;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.security.access.method.P;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Transient;
import java.math.BigDecimal;

/**
 * @author drj
 * @description 门店
 * @create 2018-10-29 10:02:38
 **/
@Data
@Entity
@EqualsAndHashCode(callSuper = true)
public class Store extends BaseEntity {

    @NotBlank(message = "请填写门店名称")
    private String name;
    private String userId; // 所属商户Id
    @NotBlank(message = "请填写联系方式")
    private String phone;//门店联系方式
    @NotBlank(message = "请填写地址")
    private String address;//地址
    @NotBlank(message = "请填写营业时间")
    private String businessTime;//营业时间
    @NotBlank(message = "请设置营业方式")
    private Integer businessType;  //营业方式 1.自动根据营业时间修改营业方式      2.手动设置是否正在营业
    private Boolean isDoBusiness;//是否正在营业 true 营业中 false 停业中
    @NotBlank(message = "请填写公告")
    private String notice;//公告
    @NotBlank(message = "请上传门店图片")
    @Column(columnDefinition = "TEXT")
    private String photo;//门店图片
    private Integer supporyPayWay;//支持支付方式  1:线上,2:线下,3:共同支持
    //优惠券模块新建配置
    private Integer advanceProvideTime; //提前通知时间
    @Column(columnDefinition = "decimal(10,4)")
    private BigDecimal integralRatio;   //积分比例
    //默认用户分享活动信息
    private String eventTitle;
    private String eventInfo;
    private String eventImg;
    @Transient
    @Relation(relationType = RelationType.ONE,idProperty = "userId",serviceName = "userService")
    private User user;


}
